package cn.kgc.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 课工场
 * @date 2024/10/15
 * @description
 */
@Configuration
public class BeanConfig {

    @Bean
    @LoadBalanced   //  让spring容器中的RestTemplate 拥有负载均衡能力
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}
